from ursina import *

app = Ursina()

class Test_cube(Entity):
    def __init__(self):
        super().__init__(
            model='cube',
            texture='Sans.png',
            rotation = Vec3(45,45,45)
        )

class Test_button(Button):
    def __init__(self):
        super().__init__(
            parent = scene,
            model='cube',
            texture='birck',
            color = color.white,
            highlight_color = color.red,
            pressed_color = color.orange
        )
def update():
    if held_keys['a']: #如果按下'a'键
        test.x = test.x - 1*time.dt #移动 1*time.dt意思是慢一点

test = Entity(model='cube',color=color.orange,scale=1,position=(5,0))
test2 = Text(test='hello',scale=2)
#test3 = Entity(model='cube',texture='Sans.png') #texture 导入图片
test4 = Test_cube()
test5 = Test_button()
app.run()